#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;

int GetMonthDay(int year, int month)
{
    int arr[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
    if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
    {
        return 29;
    }
    return arr[month];
}

int main() {
    int y1, y2;
    int count = 1;

    while (cin >> y1 >> y2) {
        int max, min;
        if (y1 > y2)
        {
            max = y1;
            min = y2;
        }
        else {
            max = y2;
            min = y1;
        }
        int year_min = (min / 10000);
        int month_min = (min % 10000) / 100;
        int day_min = min % 100;

        int year_max = (max / 10000);
        int month_max = (max % 10000) / 100;
        int day_max = max % 100;
        while ((year_min != year_max) || (month_min != month_max) || (day_min != day_max)) {
            day_min++;
            count++;
            if (day_min > GetMonthDay(year_min, month_min))
            {
                day_min = 1;
                month_min++;
                if (month_min > 12)
                {
                    year_min++;
                    month_min = 1;
                }
            }
        }
    }
    cout << count << endl;

}